﻿using System;
using System.Collections.Generic;
using System.Text;
using Model;
using System.Data;
using System.Data.SqlClient;
using HT.DBUtility;

namespace HT.DAL
{
  public   class Dal_SpdaH_1
    {
      public Dal_SpdaH_1()
      { }

      #region  Method


 
      /// <summary>
      /// 更新一条数据
      /// </summary>
      public bool Update(SpdaHModel model)
      {
          StringBuilder strSql = new StringBuilder();
          strSql.Append("update spdaH set ");
          strSql.Append("DjLsh=@DjLsh,");
          strSql.Append("DjBtZdh=@DjBtZdh,");
          strSql.Append("DjFtZdh=@DjFtZdh,");
          strSql.Append("DjStZdh=@DjStZdh,");
          strSql.Append("DjState=@DjState,");
          strSql.Append("DjCount=@DjCount,");
          strSql.Append("bhfs=@bhfs,");
          strSql.Append("djcl=@djcl,");
          strSql.Append("lsh=@lsh,");
          strSql.Append("rq=@rq,");
          strSql.Append("dlbh=@dlbh,");
          strSql.Append("dlmc=@dlmc,");
          strSql.Append("xlbh=@xlbh,");
          strSql.Append("xlmc=@xlmc,");
          strSql.Append("gysbh=@gysbh,");
          strSql.Append("Gysmc=@Gysmc,");
          strSql.Append("cjhh=@cjhh,");
          strSql.Append("spbh=@spbh,");
          strSql.Append("tmh=@tmh,");
          strSql.Append("spmc=@spmc,");
          strSql.Append("gg=@gg,");
          strSql.Append("ysbh=@ysbh,");
          strSql.Append("ysmc=@ysmc,");
          strSql.Append("cm=@cm,");
          strSql.Append("Pyjm=@Pyjm,");
          strSql.Append("ddw=@ddw,");
          strSql.Append("xdw=@xdw,");
          strSql.Append("dwhsz=@dwhsz,");
          strSql.Append("jj=@jj,");
          strSql.Append("Lsj_Jsz=@Lsj_Jsz,");
          strSql.Append("Lsj_Csxs=@Lsj_Csxs,");
          strSql.Append("pfj_Jsz=@pfj_Jsz,");
          strSql.Append("pfj_Csxs=@pfj_Csxs,");
          strSql.Append("pfj=@pfj,");
          strSql.Append("Jmlsj=@Jmlsj,");
          strSql.Append("pfzk=@pfzk,");
          strSql.Append("Hyzz=@Hyzz,");
          strSql.Append("Hyyh=@Hyyh,");
          strSql.Append("tp=@tp,");
          strSql.Append("spzt=@spzt,");
          strSql.Append("qdpl=@qdpl,");
          strSql.Append("Ccrq=@Ccrq,");
          strSql.Append("bzq=@bzq,");
          strSql.Append("tqyjts=@tqyjts,");
          strSql.Append("zdkc=@zdkc,");
          strSql.Append("zxkc=@zxkc,");
          strSql.Append("zjhl=@zjhl,");
          strSql.Append("bz=@bz,");
          strSql.Append("zhjhsj=@zhjhsj,");
          strSql.Append("sccgybh=@sccgybh,");
          strSql.Append("djyh=@djyh,");
          strSql.Append("djsj=@djsj,");
          strSql.Append("xgyh=@xgyh,");
          strSql.Append("xgsj=@xgsj,");
          strSql.Append("cwm=@cwm,");
          strSql.Append("fhljs=@fhljs,");
          strSql.Append("sfdz=@sfdz,");
          strSql.Append("dysl=@dysl,");
          strSql.Append("ydy=@ydy,");
          strSql.Append("drlsh=@drlsh");
          strSql.Append(" where ");
          SqlParameter[] parameters = {
					new SqlParameter("@DjLsh", SqlDbType.Int,4),
					new SqlParameter("@DjBtZdh", SqlDbType.Int,4),
					new SqlParameter("@DjFtZdh", SqlDbType.Int,4),
					new SqlParameter("@DjStZdh", SqlDbType.Int,4),
					new SqlParameter("@DjState", SqlDbType.Char,4),
					new SqlParameter("@DjCount", SqlDbType.Int,4),
					new SqlParameter("@bhfs", SqlDbType.VarChar,10),
					new SqlParameter("@djcl", SqlDbType.VarChar,10),
					new SqlParameter("@lsh", SqlDbType.Int,4),
					new SqlParameter("@rq", SqlDbType.VarChar,10),
					new SqlParameter("@dlbh", SqlDbType.VarChar,10),
					new SqlParameter("@dlmc", SqlDbType.VarChar,20),
					new SqlParameter("@xlbh", SqlDbType.VarChar,10),
					new SqlParameter("@xlmc", SqlDbType.VarChar,20),
					new SqlParameter("@gysbh", SqlDbType.VarChar,10),
					new SqlParameter("@Gysmc", SqlDbType.VarChar,20),
					new SqlParameter("@cjhh", SqlDbType.VarChar,20),
					new SqlParameter("@spbh", SqlDbType.VarChar,20),
					new SqlParameter("@tmh", SqlDbType.VarChar,20),
					new SqlParameter("@spmc", SqlDbType.VarChar,50),
					new SqlParameter("@gg", SqlDbType.VarChar,20),
					new SqlParameter("@ysbh", SqlDbType.VarChar,10),
					new SqlParameter("@ysmc", SqlDbType.VarChar,20),
					new SqlParameter("@cm", SqlDbType.VarChar,20),
					new SqlParameter("@Pyjm", SqlDbType.VarChar,20),
					new SqlParameter("@ddw", SqlDbType.VarChar,10),
					new SqlParameter("@xdw", SqlDbType.VarChar,10),
					new SqlParameter("@dwhsz", SqlDbType.Decimal,9),
					new SqlParameter("@jj", SqlDbType.Money,8),
					new SqlParameter("@Lsj_Jsz", SqlDbType.Decimal,9),
					new SqlParameter("@Lsj_Csxs", SqlDbType.Decimal,9),
					new SqlParameter("@pfj_Jsz", SqlDbType.Decimal,9),
					new SqlParameter("@pfj_Csxs", SqlDbType.Decimal,9),
					new SqlParameter("@pfj", SqlDbType.Money,8),
					new SqlParameter("@Jmlsj", SqlDbType.Money,8),
					new SqlParameter("@pfzk", SqlDbType.Decimal,9),
					new SqlParameter("@Hyzz", SqlDbType.Decimal,9),
					new SqlParameter("@Hyyh", SqlDbType.Decimal,9),
					new SqlParameter("@tp", SqlDbType.Image),
					new SqlParameter("@spzt", SqlDbType.VarChar,10),
					new SqlParameter("@qdpl", SqlDbType.Int,4),
					new SqlParameter("@Ccrq", SqlDbType.DateTime),
					new SqlParameter("@bzq", SqlDbType.Int,4),
					new SqlParameter("@tqyjts", SqlDbType.Int,4),
					new SqlParameter("@zdkc", SqlDbType.Int,4),
					new SqlParameter("@zxkc", SqlDbType.Int,4),
					new SqlParameter("@zjhl", SqlDbType.Int,4),
					new SqlParameter("@bz", SqlDbType.VarChar,100),
					new SqlParameter("@zhjhsj", SqlDbType.DateTime),
					new SqlParameter("@sccgybh", SqlDbType.VarChar,10),
					new SqlParameter("@djyh", SqlDbType.VarChar,10),
					new SqlParameter("@djsj", SqlDbType.DateTime),
					new SqlParameter("@xgyh", SqlDbType.VarChar,10),
					new SqlParameter("@xgsj", SqlDbType.DateTime),
					new SqlParameter("@cwm", SqlDbType.VarChar,10),
					new SqlParameter("@fhljs", SqlDbType.Int,4),
					new SqlParameter("@sfdz", SqlDbType.Bit,1),
					new SqlParameter("@dysl", SqlDbType.Int,4),
					new SqlParameter("@ydy", SqlDbType.Bit,1),
					new SqlParameter("@drlsh", SqlDbType.Int,4)};
          parameters[0].Value = model.DjLsh;
          parameters[1].Value = model.DjBtZdh;
          parameters[2].Value = model.DjFtZdh;
          parameters[3].Value = model.DjStZdh;
          parameters[4].Value = model.DjState;
          parameters[5].Value = model.DjCount;
          parameters[6].Value = model.bhfs;
          parameters[7].Value = model.djcl;
          parameters[8].Value = model.lsh;
          parameters[9].Value = model.rq;
          parameters[10].Value = model.dlbh;
          parameters[11].Value = model.dlmc;
          parameters[12].Value = model.xlbh;
          parameters[13].Value = model.xlmc;
          parameters[14].Value = model.gysbh;
          parameters[15].Value = model.Gysmc;
          parameters[16].Value = model.cjhh;
          parameters[17].Value = model.spbh;
          parameters[18].Value = model.tmh;
          parameters[19].Value = model.spmc;
          parameters[20].Value = model.gg;
          parameters[21].Value = model.ysbh;
          parameters[22].Value = model.ysmc;
          parameters[23].Value = model.cm;
          parameters[24].Value = model.Pyjm;
          parameters[25].Value = model.ddw;
          parameters[26].Value = model.xdw;
          parameters[27].Value = model.dwhsz;
          parameters[28].Value = model.jj;
          parameters[29].Value = model.Lsj_Jsz;
          parameters[30].Value = model.Lsj_Csxs;
          parameters[31].Value = model.pfj_Jsz;
          parameters[32].Value = model.pfj_Csxs;
          parameters[33].Value = model.pfj;
          parameters[34].Value = model.Jmlsj;
          parameters[35].Value = model.pfzk;
          parameters[36].Value = model.Hyzz;
          parameters[37].Value = model.Hyyh;
          parameters[38].Value = model.tp;
          parameters[39].Value = model.spzt;
          parameters[40].Value = model.qdpl;
          parameters[41].Value = model.Ccrq;
          parameters[42].Value = model.bzq;
          parameters[43].Value = model.tqyjts;
          parameters[44].Value = model.zdkc;
          parameters[45].Value = model.zxkc;
          parameters[46].Value = model.zjhl;
          parameters[47].Value = model.bz;
          parameters[48].Value = model.zhjhsj;
          parameters[49].Value = model.sccgybh;
          parameters[50].Value = model.djyh;
          parameters[51].Value = model.djsj;
          parameters[52].Value = model.xgyh;
          parameters[53].Value = model.xgsj;
          parameters[54].Value = model.cwm;
          parameters[55].Value = model.fhljs;
          parameters[56].Value = model.sfdz;
          parameters[57].Value = model.dysl;
          parameters[58].Value = model.ydy;
          parameters[59].Value = model.drlsh;

          int rows = SQLHelper.ExecuteSql(strSql.ToString(), parameters);
          if (rows > 0)
          {
              return true;
          }
          else
          {
              return false;
          }
      }



      /// <summary>
      /// 得到一个对象实体
      /// </summary>
      public SpdaHModel GetModel(string spbh)
      {
          //该表无主键信息，请自定义主键/条件字段
          StringBuilder strSql = new StringBuilder();
          strSql.Append("select  top 1 DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,bhfs,djcl,lsh,rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,cjhh,spbh,tmh,spmc,gg,ysbh,ysmc,cm,Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,tp,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh,djyh,djsj,xgyh,xgsj,cwm,fhljs,sfdz,dysl,ydy,drlsh from spdaH ");
          strSql.Append(" where   spbh='"+spbh+"'");
 

          SpdaHModel model = new SpdaHModel();
          DataTable  dt =SQLHelper.ExecuteDt(strSql.ToString());
          if (dt.Rows.Count > 0)
          {
              if (dt.Rows[0]["DjLsh"] != null && dt.Rows[0]["DjLsh"].ToString() != "")
              {
                  model.DjLsh = int.Parse(dt.Rows[0]["DjLsh"].ToString());
              }
              if (dt.Rows[0]["DjBtZdh"] != null && dt.Rows[0]["DjBtZdh"].ToString() != "")
              {
                  model.DjBtZdh = int.Parse(dt.Rows[0]["DjBtZdh"].ToString());
              }
              if (dt.Rows[0]["DjFtZdh"] != null && dt.Rows[0]["DjFtZdh"].ToString() != "")
              {
                  model.DjFtZdh = int.Parse(dt.Rows[0]["DjFtZdh"].ToString());
              }
              if (dt.Rows[0]["DjStZdh"] != null && dt.Rows[0]["DjStZdh"].ToString() != "")
              {
                  model.DjStZdh = int.Parse(dt.Rows[0]["DjStZdh"].ToString());
              }
              if (dt.Rows[0]["DjState"] != null && dt.Rows[0]["DjState"].ToString() != "")
              {
                  model.DjState = dt.Rows[0]["DjState"].ToString();
              }
              if (dt.Rows[0]["DjCount"] != null && dt.Rows[0]["DjCount"].ToString() != "")
              {
                  model.DjCount = int.Parse(dt.Rows[0]["DjCount"].ToString());
              }
              if (dt.Rows[0]["bhfs"] != null && dt.Rows[0]["bhfs"].ToString() != "")
              {
                  model.bhfs = dt.Rows[0]["bhfs"].ToString();
              }
              if (dt.Rows[0]["djcl"] != null && dt.Rows[0]["djcl"].ToString() != "")
              {
                  model.djcl = dt.Rows[0]["djcl"].ToString();
              }
              if (dt.Rows[0]["lsh"] != null && dt.Rows[0]["lsh"].ToString() != "")
              {
                  model.lsh = int.Parse(dt.Rows[0]["lsh"].ToString());
              }
              if (dt.Rows[0]["rq"] != null && dt.Rows[0]["rq"].ToString() != "")
              {
                  model.rq = dt.Rows[0]["rq"].ToString();
              }
              if (dt.Rows[0]["dlbh"] != null && dt.Rows[0]["dlbh"].ToString() != "")
              {
                  model.dlbh = dt.Rows[0]["dlbh"].ToString();
              }
              if (dt.Rows[0]["dlmc"] != null && dt.Rows[0]["dlmc"].ToString() != "")
              {
                  model.dlmc = dt.Rows[0]["dlmc"].ToString();
              }
              if (dt.Rows[0]["xlbh"] != null && dt.Rows[0]["xlbh"].ToString() != "")
              {
                  model.xlbh = dt.Rows[0]["xlbh"].ToString();
              }
              if (dt.Rows[0]["xlmc"] != null && dt.Rows[0]["xlmc"].ToString() != "")
              {
                  model.xlmc = dt.Rows[0]["xlmc"].ToString();
              }
              if (dt.Rows[0]["gysbh"] != null && dt.Rows[0]["gysbh"].ToString() != "")
              {
                  model.gysbh = dt.Rows[0]["gysbh"].ToString();
              }
              if (dt.Rows[0]["Gysmc"] != null && dt.Rows[0]["Gysmc"].ToString() != "")
              {
                  model.Gysmc = dt.Rows[0]["Gysmc"].ToString();
              }
              if (dt.Rows[0]["cjhh"] != null && dt.Rows[0]["cjhh"].ToString() != "")
              {
                  model.cjhh = dt.Rows[0]["cjhh"].ToString();
              }
              if (dt.Rows[0]["spbh"] != null && dt.Rows[0]["spbh"].ToString() != "")
              {
                  model.spbh = dt.Rows[0]["spbh"].ToString();
              }
              if (dt.Rows[0]["tmh"] != null && dt.Rows[0]["tmh"].ToString() != "")
              {
                  model.tmh = dt.Rows[0]["tmh"].ToString();
              }
              if (dt.Rows[0]["spmc"] != null && dt.Rows[0]["spmc"].ToString() != "")
              {
                  model.spmc = dt.Rows[0]["spmc"].ToString();
              }
              if (dt.Rows[0]["gg"] != null && dt.Rows[0]["gg"].ToString() != "")
              {
                  model.gg = dt.Rows[0]["gg"].ToString();
              }
              if (dt.Rows[0]["ysbh"] != null && dt.Rows[0]["ysbh"].ToString() != "")
              {
                  model.ysbh = dt.Rows[0]["ysbh"].ToString();
              }
              if (dt.Rows[0]["ysmc"] != null && dt.Rows[0]["ysmc"].ToString() != "")
              {
                  model.ysmc = dt.Rows[0]["ysmc"].ToString();
              }
              if (dt.Rows[0]["cm"] != null && dt.Rows[0]["cm"].ToString() != "")
              {
                  model.cm = dt.Rows[0]["cm"].ToString();
              }
              if (dt.Rows[0]["Pyjm"] != null && dt.Rows[0]["Pyjm"].ToString() != "")
              {
                  model.Pyjm = dt.Rows[0]["Pyjm"].ToString();
              }
              if (dt.Rows[0]["ddw"] != null && dt.Rows[0]["ddw"].ToString() != "")
              {
                  model.ddw = dt.Rows[0]["ddw"].ToString();
              }
              if (dt.Rows[0]["xdw"] != null && dt.Rows[0]["xdw"].ToString() != "")
              {
                  model.xdw = dt.Rows[0]["xdw"].ToString();
              }
              if (dt.Rows[0]["dwhsz"] != null && dt.Rows[0]["dwhsz"].ToString() != "")
              {
                  model.dwhsz = decimal.Parse(dt.Rows[0]["dwhsz"].ToString());
              }
              if (dt.Rows[0]["jj"] != null && dt.Rows[0]["jj"].ToString() != "")
              {
                  model.jj = decimal.Parse(dt.Rows[0]["jj"].ToString());
              }
              if (dt.Rows[0]["Lsj_Jsz"] != null && dt.Rows[0]["Lsj_Jsz"].ToString() != "")
              {
                  model.Lsj_Jsz = decimal.Parse(dt.Rows[0]["Lsj_Jsz"].ToString());
              }
              if (dt.Rows[0]["Lsj_Csxs"] != null && dt.Rows[0]["Lsj_Csxs"].ToString() != "")
              {
                  model.Lsj_Csxs = decimal.Parse(dt.Rows[0]["Lsj_Csxs"].ToString());
              }
              if (dt.Rows[0]["pfj_Jsz"] != null && dt.Rows[0]["pfj_Jsz"].ToString() != "")
              {
                  model.pfj_Jsz = decimal.Parse(dt.Rows[0]["pfj_Jsz"].ToString());
              }
              if (dt.Rows[0]["pfj_Csxs"] != null && dt.Rows[0]["pfj_Csxs"].ToString() != "")
              {
                  model.pfj_Csxs = decimal.Parse(dt.Rows[0]["pfj_Csxs"].ToString());
              }
              if (dt.Rows[0]["pfj"] != null && dt.Rows[0]["pfj"].ToString() != "")
              {
                  model.pfj = decimal.Parse(dt.Rows[0]["pfj"].ToString());
              }
              if (dt.Rows[0]["Jmlsj"] != null && dt.Rows[0]["Jmlsj"].ToString() != "")
              {
                  model.Jmlsj = decimal.Parse(dt.Rows[0]["Jmlsj"].ToString());
              }
              if (dt.Rows[0]["pfzk"] != null && dt.Rows[0]["pfzk"].ToString() != "")
              {
                  model.pfzk = decimal.Parse(dt.Rows[0]["pfzk"].ToString());
              }
              if (dt.Rows[0]["Hyzz"] != null && dt.Rows[0]["Hyzz"].ToString() != "")
              {
                  model.Hyzz = decimal.Parse(dt.Rows[0]["Hyzz"].ToString());
              }
              if (dt.Rows[0]["Hyyh"] != null && dt.Rows[0]["Hyyh"].ToString() != "")
              {
                  model.Hyyh = decimal.Parse(dt.Rows[0]["Hyyh"].ToString());
              }
              if (dt.Rows[0]["tp"] != null && dt.Rows[0]["tp"].ToString() != "")
              {
                  model.tp = (byte[])dt.Rows[0]["tp"];
              }
              if (dt.Rows[0]["spzt"] != null && dt.Rows[0]["spzt"].ToString() != "")
              {
                  model.spzt = dt.Rows[0]["spzt"].ToString();
              }
              if (dt.Rows[0]["qdpl"] != null && dt.Rows[0]["qdpl"].ToString() != "")
              {
                  model.qdpl = int.Parse(dt.Rows[0]["qdpl"].ToString());
              }
              if (dt.Rows[0]["Ccrq"] != null && dt.Rows[0]["Ccrq"].ToString() != "")
              {
                  model.Ccrq = DateTime.Parse(dt.Rows[0]["Ccrq"].ToString());
              }
              if (dt.Rows[0]["bzq"] != null && dt.Rows[0]["bzq"].ToString() != "")
              {
                  model.bzq = int.Parse(dt.Rows[0]["bzq"].ToString());
              }
              if (dt.Rows[0]["tqyjts"] != null && dt.Rows[0]["tqyjts"].ToString() != "")
              {
                  model.tqyjts = int.Parse(dt.Rows[0]["tqyjts"].ToString());
              }
              if (dt.Rows[0]["zdkc"] != null && dt.Rows[0]["zdkc"].ToString() != "")
              {
                  model.zdkc = int.Parse(dt.Rows[0]["zdkc"].ToString());
              }
              if (dt.Rows[0]["zxkc"] != null && dt.Rows[0]["zxkc"].ToString() != "")
              {
                  model.zxkc = int.Parse(dt.Rows[0]["zxkc"].ToString());
              }
              if (dt.Rows[0]["zjhl"] != null && dt.Rows[0]["zjhl"].ToString() != "")
              {
                  model.zjhl = int.Parse(dt.Rows[0]["zjhl"].ToString());
              }
              if (dt.Rows[0]["bz"] != null && dt.Rows[0]["bz"].ToString() != "")
              {
                  model.bz = dt.Rows[0]["bz"].ToString();
              }
              if (dt.Rows[0]["zhjhsj"] != null && dt.Rows[0]["zhjhsj"].ToString() != "")
              {
                  model.zhjhsj = DateTime.Parse(dt.Rows[0]["zhjhsj"].ToString());
              }
              if (dt.Rows[0]["sccgybh"] != null && dt.Rows[0]["sccgybh"].ToString() != "")
              {
                  model.sccgybh = dt.Rows[0]["sccgybh"].ToString();
              }
              if (dt.Rows[0]["djyh"] != null && dt.Rows[0]["djyh"].ToString() != "")
              {
                  model.djyh = dt.Rows[0]["djyh"].ToString();
              }
              if (dt.Rows[0]["djsj"] != null && dt.Rows[0]["djsj"].ToString() != "")
              {
                  model.djsj = DateTime.Parse(dt.Rows[0]["djsj"].ToString());
              }
              if (dt.Rows[0]["xgyh"] != null && dt.Rows[0]["xgyh"].ToString() != "")
              {
                  model.xgyh = dt.Rows[0]["xgyh"].ToString();
              }
              if (dt.Rows[0]["xgsj"] != null && dt.Rows[0]["xgsj"].ToString() != "")
              {
                  model.xgsj = DateTime.Parse(dt.Rows[0]["xgsj"].ToString());
              }
              if (dt.Rows[0]["cwm"] != null && dt.Rows[0]["cwm"].ToString() != "")
              {
                  model.cwm = dt.Rows[0]["cwm"].ToString();
              }
              if (dt.Rows[0]["fhljs"] != null && dt.Rows[0]["fhljs"].ToString() != "")
              {
                  model.fhljs = int.Parse(dt.Rows[0]["fhljs"].ToString());
              }
              if (dt.Rows[0]["sfdz"] != null && dt.Rows[0]["sfdz"].ToString() != "")
              {
                  if ((dt.Rows[0]["sfdz"].ToString() == "1") || (dt.Rows[0]["sfdz"].ToString().ToLower() == "true"))
                  {
                      model.sfdz = true;
                  }
                  else
                  {
                      model.sfdz = false;
                  }
              }
              if (dt.Rows[0]["dysl"] != null && dt.Rows[0]["dysl"].ToString() != "")
              {
                  model.dysl = int.Parse(dt.Rows[0]["dysl"].ToString());
              }
              if (dt.Rows[0]["ydy"] != null && dt.Rows[0]["ydy"].ToString() != "")
              {
                  if ((dt.Rows[0]["ydy"].ToString() == "1") || (dt.Rows[0]["ydy"].ToString().ToLower() == "true"))
                  {
                      model.ydy = true;
                  }
                  else
                  {
                      model.ydy = false;
                  }
              }
              if (dt.Rows[0]["drlsh"] != null && dt.Rows[0]["drlsh"].ToString() != "")
              {
                  model.drlsh = int.Parse(dt.Rows[0]["drlsh"].ToString());
              }
              return model;
          }
          else
          {
              return null;
          }
      }
 
      /// 获得数据列表
      /// </summary>
      public DataTable GetList(string strWhere)
      {
          StringBuilder strSql = new StringBuilder();
          strSql.Append("select DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,bhfs,djcl,lsh,rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,cjhh,spbh,tmh,spmc,gg,ysbh,ysmc,cm,Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,tp,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh,djyh,djsj,xgyh,xgsj,cwm,fhljs,sfdz,dysl,ydy,drlsh ");
        //  strSql.Append("select distinct rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,tmh, gg, Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh   ");
         
          strSql.Append(" FROM spdaH ");
          if (strWhere.Trim() != "")
          {
              strSql.Append(" where " + strWhere);
          }
          return SQLHelper.ExecuteDs(strSql.ToString()).Tables[0];
      }

      /// 获得数据列表
      /// </summary>
      public DataTable GetList(string strWhere,ref string sql)
      {
          StringBuilder strSql = new StringBuilder();
          strSql.Append("select DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,bhfs,djcl,lsh,rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,cjhh,spbh,tmh,spmc,gg,ysbh,ysmc,cm,Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,tp,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh,djyh,djsj,xgyh,xgsj,cwm,fhljs,sfdz,dysl,ydy,drlsh ");
        //  strSql.Append("select distinct rq,dlbh,dlmc,xlbh,xlmc,gysbh,Gysmc,tmh, gg, Pyjm,ddw,xdw,dwhsz,jj,Lsj_Jsz,Lsj_Csxs,pfj_Jsz,pfj_Csxs,pfj,Jmlsj,pfzk,Hyzz,Hyyh,spzt,qdpl,Ccrq,bzq,tqyjts,zdkc,zxkc,zjhl,bz,zhjhsj,sccgybh   ");

          strSql.Append(" FROM spdaH ");
          if (strWhere.Trim() != "")
          {
              strSql.Append(" where " + strWhere);
          }
          sql = strSql.ToString();
          return SQLHelper.ExecuteDs(strSql.ToString()).Tables[0];
      }

      #endregion  Method

    }
}
